# Tanım: Ücretsiz açık kaynak SQL tam metin arama motoru.
# URL: http://www.sphinxsearch.com/
# Paketçi: Cihan_Alkan
# Gerekler: expat mariadb
# Grup: 

isim=sphinx
surum=2.2.11
devir=1

kaynak=(http://sphinxsearch.com/files/${isim}-${surum}-release.tar.gz)

derle() {

  sed -i '15199,15199 s/x00/x21/' "${SRC}/${isim}-${surum}-release/src/searchd.cpp"

  cd "${SRC}/${isim}-${surum}-release"
  ./configure --prefix=/usr --exec-prefix=/usr --localstatedir=/var/lib/sphinx \
    --sysconfdir=/etc/sphinx --with-pgsql --enable-id64

  make

  make DESTDIR="${PKG}" install

  for _f in "${PKG}/usr/bin/"*; do
    ln -s "/usr/bin/${_f##*/}" "${PKG}/usr/bin/sphinx-${_f##*/}"
  done

#  install -Dm755 "${SRC}/sphinx.rc.d" "${PKG}/etc/rc.d/sphinx"
#  install -Dm644 "${SRC}/sphinx.conf.d" "${PKG}/etc/conf.d/sphinx"
#  install -Dm644 "${SRC}/sphinx.service" "${PKG}/usr/lib/systemd/system/sphinx.service"
#  install -d "${PKG}/usr/share/sphinx/lib"
#  install -Dm644 api/sphinxapi.php "${PKG}/usr/share/sphinx/lib/sphinxapi.php"
 # install -Dm644 api/sphinxapi.py "${PKG}/usr/share/sphinx/lib/sphinxapi.py"
#  install -Dm644 "${SRC}/sphinx.tmpfiles.conf" "${PKG}/usr/lib/tmpfiles.d/sphinx.conf"
}
